package com.mo.lib.utils.content

import android.app.Activity
import com.dylanc.longan.activityList


/**
 * @ author：mo
 * @ data：2022/4/21:9:56
 * @ 功能：
 */

/**
 * 结束指定类名的Activity
 */
fun finishActivity(cls: Class<*>) {
    for (activity in activityList) {
        if (activity.javaClass == cls) {
            activity.finish()
        }
    }
}

/**
 * 结束指定类名以外的其他所有Activity
 *
 * @param cls
 */
fun finishOtherActivity(cls: Class<*>) {
    for (activity in activityList) {
        if (activity.javaClass != cls) {
            activity.finish()
        }
    }
}
